<?php

namespace app\apiadmin\model\course;

use app\common\utils\Res;
use think\facade\Db;
use think\Model;


class CourseModel extends Model
{
 
    /**
     * @author: zwx
     * @Description: 分页查询数据列表
     * @param {*} $map  查询条件
     * @param {*} $offset  分页偏移量
     * @param {*} $limit  每页数量
     * @Date: 2024-05-12 14:53:13
     */
    public static function pageMap($map, $findName, $offset, $limit)
    {

        $data = Db::table('xh_siyu_course')
            ->alias('y')
            ->field($findName)
            ->where($map)->limit($offset, $limit)->select()->toArray();

        return $data;
    }

    /**
     * @author: zwx
     * @Description: 分页查询数据total
     * @param {*} $map
     * @Date: 2024-07-07 14:13:42
     */
    public static function pageMapCount($map){
        
        $data = Db::table('xh_siyu_course')
        ->alias('y')
        ->where($map)->count();

        return $data;
    }


}